package school.emm;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;
import android.widget.TextView;

public class ChatRoomActivity extends TabActivity {
	TextView test, test2;
	TabHost tabHost_;
	TabHost.TabSpec spec_;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.chatroomlayout);
        tabHost_ = getTabHost();
        createNewTab(getIntent().getStringExtra("topic").toString(), null);
        
    }
    @Override
    public void onPause() {
    	super.onPause();
    	System.out.println(tabHost_.getChildCount());
    }
    @Override
    public void onResume() {
    	super.onResume();
    	
    }
    public void createNewTab(String topic, String userlist) {
    	Intent newtab = new Intent().setClass(this, ChatRoomTab.class);
        // Initialize a TabSpec for each tab and add it to the TabHost
        spec_ = tabHost_.newTabSpec(topic).setIndicator(topic).setContent(newtab);
        tabHost_.addTab(spec_);
    }
    
 
    
}